package com.hh.bss.auth.entity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.hh.bss.util.StringHelper;





public class SystemMenu {
	
	private List children=new ArrayList();
	private Integer id;
	private String parents;
	private Integer parentId;
	
	private String url;
	private String text;
	private String appClass;
	private String script;
	private Integer isLeaf; //0否，1：是
	private Integer seq;
	private java.util.Date  createDt;
	public java.util.Date getCreateDt() {
		return createDt;
	}
	public void setCreateDt(java.util.Date createDt) {
		this.createDt = createDt;
	}
	public java.util.Date getModifiedDt() {
		return modifiedDt;
	}
	public void setModifiedDt(java.util.Date modifiedDt) {
		this.modifiedDt = modifiedDt;
	}
	private java.util.Date modifiedDt;
	public Integer getSeq() {
		return seq;
	}
	public boolean isLeaf(){
		if (isLeaf!=null&&isLeaf==1) return true;
		else return false;
	}
	public void setSeq(Integer seq) {
		this.seq = seq;
	}
	public Integer getIsLeaf() {
		return isLeaf;
	}
	public void setIsLeaf(Integer isLeaf) {
		this.isLeaf = isLeaf;
	}

	public List getChildren() {
		return children;
	}
	public void setChildren(List children) {
		this.children = children;
	}

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getParentId() {
		return parentId;
	}
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
	public String getParents() {
		return parents;
	}
	public void setParents(String parents) {
		this.parents = parents;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getAppClass() {
		return appClass;
	}
	public void setAppClass(String appClass) {
		this.appClass = appClass;
	}
	public String getScript() {
		return script;
	}
	public void setScript(String script) {
		this.script = script;
	}
	public Map getParentIds(){
		Map m=new HashMap();
		if (!StringHelper.isEmpty(parents)){
			String[] ids=parents.split("\\|");
			for (int i=0;i<ids.length;i++){
				m.put(StringHelper.parseInteger(ids[i], 0), StringHelper.parseInteger(ids[i], 0));
			}
		}
		return m;
	}
}
